added SSCLI 1.0
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / CSTFSWorkItemLinkInfoDetails / Program.cs
blobf8b0bd3089c72b619a87507e961ad3e9f5742499
1 /****************************** Module Header ******************************\
2 Module Name: Program.cs
3 Project: CSTFSWorkItemLinkInfoDetails
4 Copyright (c) Microsoft Corporation.
6 The main entry of the application. To run this application, use following command
7 arguments:
9 CSTFSWorkItemLinkInfoDetails.exe <CollectionUrl> <WorkItemID>
12 This source is subject to the Microsoft Public License.
13 See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
14 All other rights reserved.
16 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
17 EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
19 \***************************************************************************/
21 using System;
22 using System.Net;
23 using Microsoft.TeamFoundation.Client;
24 using Microsoft.TeamFoundation.WorkItemTracking.Client;
26 namespace CSTFSWorkItemLinkInfoDetails
28 class Program
30 static void Main(string[] args)
32 try
34 // There are 2 arguments.
35 if (args.Length == 2)
38 // Get CollectionUrl and WorkItemID from the arguments.
39 Uri collectionUri = new Uri(args[0]);
40 int workitemID = int.Parse(args[1]);
42 using (WorkItemLinkQuery query = new WorkItemLinkQuery(collectionUri))
45 // Get the WorkItemLinkInfoDetails list of a work item.
46 var detailsList = query.GetWorkItemLinkInfos(workitemID);
48 foreach (WorkItemLinkInfoDetails details in detailsList)
50 Console.WriteLine(details.ToString());
54 else
56 Console.WriteLine("Use following command arguments to use this application:");
57 Console.WriteLine("CSTFSWorkItemLinkInfoDetails.exe <CollectionUrl> <WorkItemID>");
60 catch (Exception ex)
62 Console.WriteLine(ex.Message);